<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__ipc.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">IPC (Inter-Processor Communication)<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >High level interface for communicating between processors on a multi-core device. </p>
<p >The IPC driver allows communication between multiple CPUs or between multiple tasks operating in different domains within a single CPU. It supports binary semaphores and message queues, similar to how they are used for task interactions in an RTOS envrionment.</p>
<h1><a class="anchor" id="subsection_ipc_features"></a>
Features</h1>
<ul>
<li>Binary semaphore for resource access control and general signalling</li>
<li>Message queue for passing data between tasks/cores</li>
</ul>
<h1><a class="anchor" id="subsection_ipc_quickstart"></a>
Quick Start</h1>
<p >For binary semaphores, initialize the semaphore for the task/CPU. Then take/give the semaphore. For queues, only one task/CPU may initialize a queue. Other tasks/CPUs then get the handle of the created queue. Use the get/put functions to take out or put in items to the queue.</p>
<h1><a class="anchor" id="section_ipc_snippets"></a>
Code Snippets</h1>
<h2><a class="anchor" id="subsection_ipc_snippet1"></a>
Snippet 1: Binary semaphore example</h2>
<div class="fragment"><div class="line">    <span class="comment">/* General: error handling is not shown. Use CY_ASSERT(CY_RSLT_SUCCESS == result); to check */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #define SEMAPHORE_NUM 0UL</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">    /*************************************************************/</span></div>
<div class="line">    <span class="comment">/* Task0 (CPU0) */</span></div>
<div class="line"><span class="comment">    /*************************************************************/</span></div>
<div class="line"> </div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt0;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> semaphore0;</div>
<div class="line"> </div>
<div class="line">    rslt0 = <a class="code hl_function" href="group__group__hal__ipc.html#gab5103d75435543dbdc92c3e0d883d496">cyhal_ipc_semaphore_init</a>(&amp;semaphore0, SEMAPHORE_NUM, <span class="keyword">false</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; IPC_OPERATIONS_LOOPS; ++i)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">if</span> (<a class="code hl_function" href="group__group__hal__ipc.html#ga2380599992f4a573e23c26c7fe4488f6">cyhal_ipc_semaphore_take</a>(&amp;semaphore0, <a class="code hl_define" href="group__group__hal__ipc.html#gafc143166a726ce930ed50e31bbb5cccc">CYHAL_IPC_NEVER_TIMEOUT</a>) == <a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a>)</div>
<div class="line">        {</div>
<div class="line">            printf(<span class="stringliteral">&quot;Hello from CPU 0\n&quot;</span>);</div>
<div class="line">            rslt0 = <a class="code hl_function" href="group__group__hal__ipc.html#gae2d8d3b44af0d4f2ed88614de5362bb4">cyhal_ipc_semaphore_give</a>(&amp;semaphore0);</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line"><span class="comment">    /*************************************************************/</span></div>
<div class="line">    <span class="comment">/* Task1 (CPU1) */</span></div>
<div class="line"><span class="comment">    /*************************************************************/</span></div>
<div class="line"> </div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt1;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> semaphore1;</div>
<div class="line"> </div>
<div class="line">    rslt1 = <a class="code hl_function" href="group__group__hal__ipc.html#gab5103d75435543dbdc92c3e0d883d496">cyhal_ipc_semaphore_init</a>(&amp;semaphore1, SEMAPHORE_NUM, <span class="keyword">false</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; IPC_OPERATIONS_LOOPS; ++i)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">if</span> (<a class="code hl_function" href="group__group__hal__ipc.html#ga2380599992f4a573e23c26c7fe4488f6">cyhal_ipc_semaphore_take</a>(&amp;semaphore1, <a class="code hl_define" href="group__group__hal__ipc.html#gafc143166a726ce930ed50e31bbb5cccc">CYHAL_IPC_NEVER_TIMEOUT</a>) == <a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a>)</div>
<div class="line">        {</div>
<div class="line">            printf(<span class="stringliteral">&quot;Hello from CPU 1\n&quot;</span>);</div>
<div class="line">            rslt1 = <a class="code hl_function" href="group__group__hal__ipc.html#gae2d8d3b44af0d4f2ed88614de5362bb4">cyhal_ipc_semaphore_give</a>(&amp;semaphore1);</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__impl__hw__types_html_structcyhal__ipc__t"><div class="ttname"><a href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a></div><div class="ttdoc">IPC object.</div><div class="ttdef"><b>Definition:</b> cyhal_hw_types.h:838</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_ga2380599992f4a573e23c26c7fe4488f6"><div class="ttname"><a href="group__group__hal__ipc.html#ga2380599992f4a573e23c26c7fe4488f6">cyhal_ipc_semaphore_take</a></div><div class="ttdeci">cy_rslt_t cyhal_ipc_semaphore_take(cyhal_ipc_t *obj, uint32_t timeout_us)</div><div class="ttdoc">Takes/acquires a semaphore.</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_gab5103d75435543dbdc92c3e0d883d496"><div class="ttname"><a href="group__group__hal__ipc.html#gab5103d75435543dbdc92c3e0d883d496">cyhal_ipc_semaphore_init</a></div><div class="ttdeci">cy_rslt_t cyhal_ipc_semaphore_init(cyhal_ipc_t *obj, uint32_t semaphore_num, bool preemptable)</div><div class="ttdoc">Creates a single semaphore based on a given number.</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_gae2d8d3b44af0d4f2ed88614de5362bb4"><div class="ttname"><a href="group__group__hal__ipc.html#gae2d8d3b44af0d4f2ed88614de5362bb4">cyhal_ipc_semaphore_give</a></div><div class="ttdeci">cy_rslt_t cyhal_ipc_semaphore_give(cyhal_ipc_t *obj)</div><div class="ttdoc">Gives/releases a semaphore.</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_gafc143166a726ce930ed50e31bbb5cccc"><div class="ttname"><a href="group__group__hal__ipc.html#gafc143166a726ce930ed50e31bbb5cccc">CYHAL_IPC_NEVER_TIMEOUT</a></div><div class="ttdeci">#define CYHAL_IPC_NEVER_TIMEOUT</div><div class="ttdoc">This define can be used as timeout argument for the IPC HAL driver functions, that take timeout as in...</div><div class="ttdef"><b>Definition:</b> cyhal_ipc.h:104</div></div>
<div class="ttc" id="agroup__group__result_html_gaca79700fcc701534ce61778a9bcf57d1"><div class="ttname"><a href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a></div><div class="ttdeci">uint32_t cy_rslt_t</div><div class="ttdoc">Provides the result of an operation as a structured bitfield.</div><div class="ttdef"><b>Definition:</b> cy_result.h:438</div></div>
<div class="ttc" id="agroup__group__result_html_gaf58fac450d9fff4472f03ad68f6e546e"><div class="ttname"><a href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a></div><div class="ttdeci">#define CY_RSLT_SUCCESS</div><div class="ttdoc">cy_rslt_t return value indicating success</div><div class="ttdef"><b>Definition:</b> cy_result.h:465</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_ipc_snippet2"></a>
Snippet 2: Message queue example</h2>
<div class="fragment"><div class="line">    <span class="comment">/* General: error handling is not shown. Use CY_ASSERT(CY_RSLT_SUCCESS == result); to check */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #define CHANNEL_NUM         CYHAL_IPC_CHAN_0</span></div>
<div class="line"><span class="preprocessor">    #define QUEUE1_NUM          1UL</span></div>
<div class="line"><span class="preprocessor">    #define QUEUE1_ITEMS        8UL</span></div>
<div class="line"><span class="preprocessor">    #define QUEUE2_NUM          2UL</span></div>
<div class="line"><span class="preprocessor">    #define QUEUE2_ITEMS        1UL</span></div>
<div class="line"><span class="preprocessor">    #define QUEUE2_MSG_LEN_MAX  25UL</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">    /*************************************************************/</span></div>
<div class="line">    <span class="comment">/* Task0 (CPU0) */</span></div>
<div class="line"><span class="comment">    /*************************************************************/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #define INVALID_SENSOR_DATA 0UL</span></div>
<div class="line"><span class="preprocessor">    #define VALID_SENSOR_DATA   1UL</span></div>
<div class="line"> </div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt0;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> task0_queue1;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> task0_queue2;</div>
<div class="line"> </div>
<div class="line">    uint32_t task0_sensor = VALID_SENSOR_DATA;</div>
<div class="line">    <span class="keywordtype">char</span>* task0_message = NULL;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Allocating in shared memory char array, that will store message from task1 */</span></div>
<div class="line">    CY_SECTION_SHAREDMEM</div>
<div class="line">    <span class="keyword">static</span> <span class="keywordtype">char</span> task1_message[QUEUE2_MSG_LEN_MAX];</div>
<div class="line">    <span class="keywordtype">char</span>* task1_message_ptr = task1_message;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Defining and allocating (shared) memory pools for queue1 and queue2 */</span></div>
<div class="line">    <span class="keywordtype">void</span>* queue1_pool, * queue2_pool;</div>
<div class="line">    CYHAL_IPC_QUEUE_POOL_ALLOC(queue1_pool, QUEUE1_ITEMS, <span class="keyword">sizeof</span>(task0_sensor));</div>
<div class="line">    CYHAL_IPC_QUEUE_POOL_ALLOC(queue2_pool, QUEUE2_ITEMS, <span class="keyword">sizeof</span>(task0_message));</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Defining and allocating (shared) memory for queue handles */</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__ipc.html#structcyhal__ipc__queue__t">cyhal_ipc_queue_t</a>* queue1_handle, * queue2_handle;</div>
<div class="line">    CYHAL_IPC_QUEUE_HANDLE_ALLOC(queue1_handle);</div>
<div class="line">    CYHAL_IPC_QUEUE_HANDLE_ALLOC(queue2_handle);</div>
<div class="line"> </div>
<div class="line">    queue1_handle-&gt;<a class="code hl_variable" href="group__group__hal__ipc.html#a7b8b0b17d8a7522c9ade9eefcf8e4ef6">channel_num</a> = CHANNEL_NUM;</div>
<div class="line">    queue1_handle-&gt;<a class="code hl_variable" href="group__group__hal__ipc.html#a2c25ff8c699e25c359ac2bda5b2e1aab">queue_num</a> = QUEUE1_NUM;</div>
<div class="line">    queue1_handle-&gt;<a class="code hl_variable" href="group__group__hal__ipc.html#ab53c6cb6f28fc7b1a234bf52fba11788">queue_pool</a> = queue1_pool;</div>
<div class="line">    queue1_handle-&gt;<a class="code hl_variable" href="group__group__hal__ipc.html#a647744a82bd9c36f9494bed04d09c1af">num_items</a> = QUEUE1_ITEMS;</div>
<div class="line">    queue1_handle-&gt;<a class="code hl_variable" href="group__group__hal__ipc.html#a29b4e980563d9d015f571310946844d6">item_size</a> = <span class="keyword">sizeof</span>(task0_sensor);</div>
<div class="line"> </div>
<div class="line">    queue2_handle-&gt;<a class="code hl_variable" href="group__group__hal__ipc.html#a7b8b0b17d8a7522c9ade9eefcf8e4ef6">channel_num</a> = CHANNEL_NUM;</div>
<div class="line">    queue2_handle-&gt;<a class="code hl_variable" href="group__group__hal__ipc.html#a2c25ff8c699e25c359ac2bda5b2e1aab">queue_num</a> = QUEUE2_NUM;</div>
<div class="line">    queue2_handle-&gt;<a class="code hl_variable" href="group__group__hal__ipc.html#ab53c6cb6f28fc7b1a234bf52fba11788">queue_pool</a> = queue2_pool;</div>
<div class="line">    queue2_handle-&gt;<a class="code hl_variable" href="group__group__hal__ipc.html#a647744a82bd9c36f9494bed04d09c1af">num_items</a> = QUEUE2_ITEMS;</div>
<div class="line">    queue2_handle-&gt;<a class="code hl_variable" href="group__group__hal__ipc.html#a29b4e980563d9d015f571310946844d6">item_size</a> = <span class="keyword">sizeof</span>(task0_message);</div>
<div class="line"> </div>
<div class="line">    rslt0 = <a class="code hl_function" href="group__group__hal__ipc.html#ga227233ba6aab201896fa6910d819827d">cyhal_ipc_queue_init</a>(&amp;task0_queue1, queue1_handle);</div>
<div class="line">    rslt0 = <a class="code hl_function" href="group__group__hal__ipc.html#ga227233ba6aab201896fa6910d819827d">cyhal_ipc_queue_init</a>(&amp;task0_queue2, queue2_handle);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; IPC_OPERATIONS_LOOPS; ++i)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">if</span> (task0_sensor != INVALID_SENSOR_DATA)</div>
<div class="line">        {</div>
<div class="line">            rslt0 = <a class="code hl_function" href="group__group__hal__ipc.html#ga0d27464dc25ca44fa9ac4c8c462742e8">cyhal_ipc_queue_put</a>(&amp;task0_queue1, &amp;task0_sensor, <a class="code hl_define" href="group__group__hal__ipc.html#gafc143166a726ce930ed50e31bbb5cccc">CYHAL_IPC_NEVER_TIMEOUT</a>);</div>
<div class="line">        }</div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">if</span> (<a class="code hl_function" href="group__group__hal__ipc.html#ga73345a07d50fa570083ab7be893405a7">cyhal_ipc_queue_get</a>(&amp;task0_queue2, &amp;task0_message,</div>
<div class="line">                                <a class="code hl_define" href="group__group__hal__ipc.html#gafc143166a726ce930ed50e31bbb5cccc">CYHAL_IPC_NEVER_TIMEOUT</a>) == <a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a>)</div>
<div class="line">        {</div>
<div class="line">            <span class="keywordflow">if</span> (task0_message != NULL)</div>
<div class="line">            {</div>
<div class="line">                printf(<span class="stringliteral">&quot;%s\n&quot;</span>, task0_message);</div>
<div class="line">                task0_message = NULL;</div>
<div class="line">            }</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line"><span class="comment">    /*************************************************************/</span></div>
<div class="line">    <span class="comment">/* Task1 (CPU1) */</span></div>
<div class="line"><span class="comment">    /*************************************************************/</span></div>
<div class="line"> </div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt1;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> task1_queue1;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> task1_queue2;</div>
<div class="line"> </div>
<div class="line">    uint32_t task1_sensor;</div>
<div class="line"> </div>
<div class="line">    rslt1 = <a class="code hl_function" href="group__group__hal__ipc.html#gaeb3c9ad4caa2220aad9cdcea180b247c">cyhal_ipc_queue_get_handle</a>(&amp;task1_queue1, CHANNEL_NUM, QUEUE1_NUM);</div>
<div class="line">    rslt1 = <a class="code hl_function" href="group__group__hal__ipc.html#gaeb3c9ad4caa2220aad9cdcea180b247c">cyhal_ipc_queue_get_handle</a>(&amp;task1_queue2, CHANNEL_NUM, QUEUE2_NUM);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; IPC_OPERATIONS_LOOPS; ++i)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">if</span> (<a class="code hl_function" href="group__group__hal__ipc.html#ga73345a07d50fa570083ab7be893405a7">cyhal_ipc_queue_get</a>(&amp;task1_queue1, &amp;task1_sensor,</div>
<div class="line">                                <a class="code hl_define" href="group__group__hal__ipc.html#gafc143166a726ce930ed50e31bbb5cccc">CYHAL_IPC_NEVER_TIMEOUT</a>) == <a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a>)</div>
<div class="line">        {</div>
<div class="line"><span class="preprocessor">            #if defined(__ARMCC_VERSION) || defined (__clang__)</span></div>
<div class="line">            sprintf(task1_message, <span class="stringliteral">&quot;Sensor data received: %u\n&quot;</span>, task1_sensor);</div>
<div class="line"><span class="preprocessor">            #else</span></div>
<div class="line">            sprintf(task1_message, <span class="stringliteral">&quot;Sensor data received: %lu\n&quot;</span>, task1_sensor);</div>
<div class="line"><span class="preprocessor">            #endif </span><span class="comment">/* __ARMCC_VERSION or other */</span><span class="preprocessor"></span></div>
<div class="line">            rslt1 = <a class="code hl_function" href="group__group__hal__ipc.html#ga0d27464dc25ca44fa9ac4c8c462742e8">cyhal_ipc_queue_put</a>(&amp;task1_queue2, &amp;task1_message_ptr, <a class="code hl_define" href="group__group__hal__ipc.html#gafc143166a726ce930ed50e31bbb5cccc">CYHAL_IPC_NEVER_TIMEOUT</a>);</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__ipc_html_a29b4e980563d9d015f571310946844d6"><div class="ttname"><a href="group__group__hal__ipc.html#a29b4e980563d9d015f571310946844d6">cyhal_ipc_queue_t::item_size</a></div><div class="ttdeci">uint32_t item_size</div><div class="ttdoc">Size of each item in the queue (populated by user during initialization)</div><div class="ttdef"><b>Definition:</b> cyhal_ipc.h:128</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_a2c25ff8c699e25c359ac2bda5b2e1aab"><div class="ttname"><a href="group__group__hal__ipc.html#a2c25ff8c699e25c359ac2bda5b2e1aab">cyhal_ipc_queue_t::queue_num</a></div><div class="ttdeci">uint32_t queue_num</div><div class="ttdoc">Queue number (populated by user during initialization)</div><div class="ttdef"><b>Definition:</b> cyhal_ipc.h:125</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_a647744a82bd9c36f9494bed04d09c1af"><div class="ttname"><a href="group__group__hal__ipc.html#a647744a82bd9c36f9494bed04d09c1af">cyhal_ipc_queue_t::num_items</a></div><div class="ttdeci">uint32_t num_items</div><div class="ttdoc">Maximum number of items allowed in the queue (populated by user during initialization)</div><div class="ttdef"><b>Definition:</b> cyhal_ipc.h:127</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_a7b8b0b17d8a7522c9ade9eefcf8e4ef6"><div class="ttname"><a href="group__group__hal__ipc.html#a7b8b0b17d8a7522c9ade9eefcf8e4ef6">cyhal_ipc_queue_t::channel_num</a></div><div class="ttdeci">uint32_t channel_num</div><div class="ttdoc">IPC channel number (e.g. CYHAL_IPC_CHAN_0) (populated by user during initialization)</div><div class="ttdef"><b>Definition:</b> cyhal_ipc.h:124</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_ab53c6cb6f28fc7b1a234bf52fba11788"><div class="ttname"><a href="group__group__hal__ipc.html#ab53c6cb6f28fc7b1a234bf52fba11788">cyhal_ipc_queue_t::queue_pool</a></div><div class="ttdeci">void * queue_pool</div><div class="ttdoc">Pointer to the queue pool (populated by user during initialization). This is pointer to shared memory...</div><div class="ttdef"><b>Definition:</b> cyhal_ipc.h:126</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_ga0d27464dc25ca44fa9ac4c8c462742e8"><div class="ttname"><a href="group__group__hal__ipc.html#ga0d27464dc25ca44fa9ac4c8c462742e8">cyhal_ipc_queue_put</a></div><div class="ttdeci">cy_rslt_t cyhal_ipc_queue_put(cyhal_ipc_t *obj, void *msg, uint32_t timeout_us)</div><div class="ttdoc">Adds one item to the queue.</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_ga227233ba6aab201896fa6910d819827d"><div class="ttname"><a href="group__group__hal__ipc.html#ga227233ba6aab201896fa6910d819827d">cyhal_ipc_queue_init</a></div><div class="ttdeci">cy_rslt_t cyhal_ipc_queue_init(cyhal_ipc_t *obj, cyhal_ipc_queue_t *queue_handle)</div><div class="ttdoc">Creates a new queue for a given IPC channel based on the given queue number and other parameters.</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_ga73345a07d50fa570083ab7be893405a7"><div class="ttname"><a href="group__group__hal__ipc.html#ga73345a07d50fa570083ab7be893405a7">cyhal_ipc_queue_get</a></div><div class="ttdeci">cy_rslt_t cyhal_ipc_queue_get(cyhal_ipc_t *obj, void *msg, uint32_t timeout_us)</div><div class="ttdoc">Removes one item from the queue.</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_gaeb3c9ad4caa2220aad9cdcea180b247c"><div class="ttname"><a href="group__group__hal__ipc.html#gaeb3c9ad4caa2220aad9cdcea180b247c">cyhal_ipc_queue_get_handle</a></div><div class="ttdeci">cy_rslt_t cyhal_ipc_queue_get_handle(cyhal_ipc_t *obj, uint32_t channel_num, uint32_t queue_num)</div><div class="ttdoc">Gets a handle pointer for a given IPC channel and queue number.</div></div>
<div class="ttc" id="agroup__group__hal__ipc_html_structcyhal__ipc__queue__t"><div class="ttname"><a href="group__group__hal__ipc.html#structcyhal__ipc__queue__t">cyhal_ipc_queue_t</a></div><div class="ttdoc">IPC queue structure element.</div><div class="ttdef"><b>Definition:</b> cyhal_ipc.h:123</div></div>
</div><!-- fragment --> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__ipc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__ipc.html">IPC HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__ipc"><td class="mdescLeft">&#160;</td><td class="mdescRight">IPC specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structcyhal__ipc__queue__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#structcyhal__ipc__queue__t">cyhal_ipc_queue_t</a></td></tr>
<tr class="memdesc:structcyhal__ipc__queue__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">IPC queue structure element.  <a href="group__group__hal__ipc.html#structcyhal__ipc__queue__t">More...</a><br /></td></tr>
<tr class="separator:structcyhal__ipc__queue__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gafc143166a726ce930ed50e31bbb5cccc"><td class="memItemLeft" align="right" valign="top"><a id="gafc143166a726ce930ed50e31bbb5cccc" name="gafc143166a726ce930ed50e31bbb5cccc"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CYHAL_IPC_NEVER_TIMEOUT</b>&#160;&#160;&#160;(0xFFFFFFFFUL)</td></tr>
<tr class="memdesc:gafc143166a726ce930ed50e31bbb5cccc"><td class="mdescLeft">&#160;</td><td class="mdescRight">This define can be used as timeout argument for the IPC HAL driver functions, that take timeout as input parameter, in order to make function never time out (wait forever) <br /></td></tr>
<tr class="separator:gafc143166a726ce930ed50e31bbb5cccc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga979b9ad680c6ae674bd93d696581c897"><td class="memItemLeft" align="right" valign="top"><a id="ga979b9ad680c6ae674bd93d696581c897" name="ga979b9ad680c6ae674bd93d696581c897"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><b>cyhal_ipc_event_callback_t</b>) (void *callback_arg, <a class="el" href="group__group__hal__ipc.html#gafc5f675378d6ed1ff7b2194defea4744">cyhal_ipc_event_t</a> event)</td></tr>
<tr class="memdesc:ga979b9ad680c6ae674bd93d696581c897"><td class="mdescLeft">&#160;</td><td class="mdescRight">Event handler for IPC interrupts. <br /></td></tr>
<tr class="separator:ga979b9ad680c6ae674bd93d696581c897"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gafc5f675378d6ed1ff7b2194defea4744"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#gafc5f675378d6ed1ff7b2194defea4744">cyhal_ipc_event_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__ipc.html#ggafc5f675378d6ed1ff7b2194defea4744a7485a38af1c68f218f3600ac537ad6e6">CYHAL_IPC_NO_INTR</a> = 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__ipc.html#ggafc5f675378d6ed1ff7b2194defea4744a2db9e15f882cf6d039ba1202969bc6c2">CYHAL_IPC_QUEUE_WRITE</a> = 1 &lt;&lt; 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__ipc.html#ggafc5f675378d6ed1ff7b2194defea4744a304e44ce1ca284fb19474864b642aed7">CYHAL_IPC_QUEUE_READ</a> = 1 &lt;&lt; 1
, <br />
&#160;&#160;<a class="el" href="group__group__hal__ipc.html#ggafc5f675378d6ed1ff7b2194defea4744a4327e5bbf3a3f1195a842b387b2bdab2">CYHAL_IPC_QUEUE_FULL</a> = 1 &lt;&lt; 2
, <br />
&#160;&#160;<a class="el" href="group__group__hal__ipc.html#ggafc5f675378d6ed1ff7b2194defea4744ac4c8cde7f590888b434a51c095d76626">CYHAL_IPC_QUEUE_EMPTY</a> = 1 &lt;&lt; 3
, <br />
&#160;&#160;<a class="el" href="group__group__hal__ipc.html#ggafc5f675378d6ed1ff7b2194defea4744acf11c6dfa24aeb75841c8a9fd60ad0d7">CYHAL_IPC_QUEUE_RESET</a> = 1 &lt;&lt; 4
<br />
 }</td></tr>
<tr class="memdesc:gafc5f675378d6ed1ff7b2194defea4744"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flags enum of IPC events.  <a href="group__group__hal__ipc.html#gafc5f675378d6ed1ff7b2194defea4744">More...</a><br /></td></tr>
<tr class="separator:gafc5f675378d6ed1ff7b2194defea4744"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gab5103d75435543dbdc92c3e0d883d496"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#gab5103d75435543dbdc92c3e0d883d496">cyhal_ipc_semaphore_init</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj, uint32_t semaphore_num, bool preemptable)</td></tr>
<tr class="memdesc:gab5103d75435543dbdc92c3e0d883d496"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a single semaphore based on a given number.  <a href="group__group__hal__ipc.html#gab5103d75435543dbdc92c3e0d883d496">More...</a><br /></td></tr>
<tr class="separator:gab5103d75435543dbdc92c3e0d883d496"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga05b484a955e2ca55b25b6bbe296abb91"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#ga05b484a955e2ca55b25b6bbe296abb91">cyhal_ipc_semaphore_free</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj)</td></tr>
<tr class="memdesc:ga05b484a955e2ca55b25b6bbe296abb91"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees the IPC semaphore.  <a href="group__group__hal__ipc.html#ga05b484a955e2ca55b25b6bbe296abb91">More...</a><br /></td></tr>
<tr class="separator:ga05b484a955e2ca55b25b6bbe296abb91"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2380599992f4a573e23c26c7fe4488f6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#ga2380599992f4a573e23c26c7fe4488f6">cyhal_ipc_semaphore_take</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj, uint32_t timeout_us)</td></tr>
<tr class="memdesc:ga2380599992f4a573e23c26c7fe4488f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Takes/acquires a semaphore.  <a href="group__group__hal__ipc.html#ga2380599992f4a573e23c26c7fe4488f6">More...</a><br /></td></tr>
<tr class="separator:ga2380599992f4a573e23c26c7fe4488f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae2d8d3b44af0d4f2ed88614de5362bb4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#gae2d8d3b44af0d4f2ed88614de5362bb4">cyhal_ipc_semaphore_give</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj)</td></tr>
<tr class="memdesc:gae2d8d3b44af0d4f2ed88614de5362bb4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gives/releases a semaphore.  <a href="group__group__hal__ipc.html#gae2d8d3b44af0d4f2ed88614de5362bb4">More...</a><br /></td></tr>
<tr class="separator:gae2d8d3b44af0d4f2ed88614de5362bb4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga227233ba6aab201896fa6910d819827d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#ga227233ba6aab201896fa6910d819827d">cyhal_ipc_queue_init</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj, <a class="el" href="group__group__hal__ipc.html#structcyhal__ipc__queue__t">cyhal_ipc_queue_t</a> *queue_handle)</td></tr>
<tr class="memdesc:ga227233ba6aab201896fa6910d819827d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new queue for a given IPC channel based on the given queue number and other parameters.  <a href="group__group__hal__ipc.html#ga227233ba6aab201896fa6910d819827d">More...</a><br /></td></tr>
<tr class="separator:ga227233ba6aab201896fa6910d819827d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafdb349be3166a4468214a10f8c031e83"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#gafdb349be3166a4468214a10f8c031e83">cyhal_ipc_queue_free</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj)</td></tr>
<tr class="memdesc:gafdb349be3166a4468214a10f8c031e83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees the queue.  <a href="group__group__hal__ipc.html#gafdb349be3166a4468214a10f8c031e83">More...</a><br /></td></tr>
<tr class="separator:gafdb349be3166a4468214a10f8c031e83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeb3c9ad4caa2220aad9cdcea180b247c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#gaeb3c9ad4caa2220aad9cdcea180b247c">cyhal_ipc_queue_get_handle</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj, uint32_t channel_num, uint32_t queue_num)</td></tr>
<tr class="memdesc:gaeb3c9ad4caa2220aad9cdcea180b247c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a handle pointer for a given IPC channel and queue number.  <a href="group__group__hal__ipc.html#gaeb3c9ad4caa2220aad9cdcea180b247c">More...</a><br /></td></tr>
<tr class="separator:gaeb3c9ad4caa2220aad9cdcea180b247c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga583dad7242f7a683a88d2299c5df9736"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#ga583dad7242f7a683a88d2299c5df9736">cyhal_ipc_queue_register_callback</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj, <a class="el" href="group__group__hal__ipc.html#ga979b9ad680c6ae674bd93d696581c897">cyhal_ipc_event_callback_t</a> callback, void *callback_arg)</td></tr>
<tr class="memdesc:ga583dad7242f7a683a88d2299c5df9736"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a callback to be executed when certain events occur.  <a href="group__group__hal__ipc.html#ga583dad7242f7a683a88d2299c5df9736">More...</a><br /></td></tr>
<tr class="separator:ga583dad7242f7a683a88d2299c5df9736"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2f12eaf1973c7b31737bfae992343d00"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#ga2f12eaf1973c7b31737bfae992343d00">cyhal_ipc_queue_enable_event</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj, <a class="el" href="group__group__hal__ipc.html#gafc5f675378d6ed1ff7b2194defea4744">cyhal_ipc_event_t</a> event, uint8_t intr_priority, bool enable)</td></tr>
<tr class="memdesc:ga2f12eaf1973c7b31737bfae992343d00"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables which events trigger the callback execution.  <a href="group__group__hal__ipc.html#ga2f12eaf1973c7b31737bfae992343d00">More...</a><br /></td></tr>
<tr class="separator:ga2f12eaf1973c7b31737bfae992343d00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0d27464dc25ca44fa9ac4c8c462742e8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#ga0d27464dc25ca44fa9ac4c8c462742e8">cyhal_ipc_queue_put</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj, void *msg, uint32_t timeout_us)</td></tr>
<tr class="memdesc:ga0d27464dc25ca44fa9ac4c8c462742e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds one item to the queue.  <a href="group__group__hal__ipc.html#ga0d27464dc25ca44fa9ac4c8c462742e8">More...</a><br /></td></tr>
<tr class="separator:ga0d27464dc25ca44fa9ac4c8c462742e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga73345a07d50fa570083ab7be893405a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#ga73345a07d50fa570083ab7be893405a7">cyhal_ipc_queue_get</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj, void *msg, uint32_t timeout_us)</td></tr>
<tr class="memdesc:ga73345a07d50fa570083ab7be893405a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes one item from the queue.  <a href="group__group__hal__ipc.html#ga73345a07d50fa570083ab7be893405a7">More...</a><br /></td></tr>
<tr class="separator:ga73345a07d50fa570083ab7be893405a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaad0ce7366f3bda19fc538231f2b62298"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#gaad0ce7366f3bda19fc538231f2b62298">cyhal_ipc_queue_count</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj)</td></tr>
<tr class="memdesc:gaad0ce7366f3bda19fc538231f2b62298"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns how many items are in the queue.  <a href="group__group__hal__ipc.html#gaad0ce7366f3bda19fc538231f2b62298">More...</a><br /></td></tr>
<tr class="separator:gaad0ce7366f3bda19fc538231f2b62298"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1b8d888b8a45e086a3489a5050f0899b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__ipc.html#ga1b8d888b8a45e086a3489a5050f0899b">cyhal_ipc_queue_reset</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *obj)</td></tr>
<tr class="memdesc:ga1b8d888b8a45e086a3489a5050f0899b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear all the items in the queue.  <a href="group__group__hal__ipc.html#ga1b8d888b8a45e086a3489a5050f0899b">More...</a><br /></td></tr>
<tr class="separator:ga1b8d888b8a45e086a3489a5050f0899b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structcyhal__ipc__queue__t" id="structcyhal__ipc__queue__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__ipc__queue__t">&#9670;&nbsp;</a></span>cyhal_ipc_queue_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_ipc_queue_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="a7b8b0b17d8a7522c9ade9eefcf8e4ef6" name="a7b8b0b17d8a7522c9ade9eefcf8e4ef6"></a>uint32_t</td>
<td class="fieldname">
channel_num</td>
<td class="fielddoc">
IPC channel number (e.g. CYHAL_IPC_CHAN_0) (populated by user during initialization) </td></tr>
<tr><td class="fieldtype">
<a id="a2c25ff8c699e25c359ac2bda5b2e1aab" name="a2c25ff8c699e25c359ac2bda5b2e1aab"></a>uint32_t</td>
<td class="fieldname">
queue_num</td>
<td class="fielddoc">
Queue number (populated by user during initialization) </td></tr>
<tr><td class="fieldtype">
<a id="ab53c6cb6f28fc7b1a234bf52fba11788" name="ab53c6cb6f28fc7b1a234bf52fba11788"></a>void *</td>
<td class="fieldname">
queue_pool</td>
<td class="fielddoc">
Pointer to the queue pool (populated by user during initialization). This is pointer to shared memory, in which queue elements will be stored. CYHAL_IPC_QUEUE_POOL_ALLOC macro can be used to allocate memory for pool. </td></tr>
<tr><td class="fieldtype">
<a id="a647744a82bd9c36f9494bed04d09c1af" name="a647744a82bd9c36f9494bed04d09c1af"></a>uint32_t</td>
<td class="fieldname">
num_items</td>
<td class="fielddoc">
Maximum number of items allowed in the queue (populated by user during initialization) </td></tr>
<tr><td class="fieldtype">
<a id="a29b4e980563d9d015f571310946844d6" name="a29b4e980563d9d015f571310946844d6"></a>uint32_t</td>
<td class="fieldname">
item_size</td>
<td class="fielddoc">
Size of each item in the queue (populated by user during initialization) </td></tr>
<tr><td class="fieldtype">
<a id="a7b2a17c779d9ce3fee74decaeec84fd8" name="a7b2a17c779d9ce3fee74decaeec84fd8"></a>uint32_t</td>
<td class="fieldname">
curr_items</td>
<td class="fielddoc">
Current number of items in the queue (not expected to be modified by user) </td></tr>
<tr><td class="fieldtype">
<a id="a46f91555597b6fc3c302d73c197275fe" name="a46f91555597b6fc3c302d73c197275fe"></a>void *</td>
<td class="fieldname">
queue_head</td>
<td class="fielddoc">
Pointer to the queue head in circular buffer (not expected to be modified by user) </td></tr>
<tr><td class="fieldtype">
<a id="a67650bce60e97f9eeb673aa40c384fa0" name="a67650bce60e97f9eeb673aa40c384fa0"></a>void *</td>
<td class="fieldname">
queue_tail</td>
<td class="fielddoc">
Pointer to the queue tail in circular buffer (not expected to be modified by user) </td></tr>
<tr><td class="fieldtype">
<a id="abdb2185b2ab93af16d5f5d6a206b7120" name="abdb2185b2ab93af16d5f5d6a206b7120"></a>uint32_t</td>
<td class="fieldname">
triggered_events</td>
<td class="fielddoc">
Events, that were triggered by latest performed operation (not expected to be modified by user) </td></tr>
<tr><td class="fieldtype">
<a id="afbd3a82afc60b2dacf35f2fe4dc9eb08" name="afbd3a82afc60b2dacf35f2fe4dc9eb08"></a>struct cyhal_ipc_queue_s *</td>
<td class="fieldname">
next_queue_obj</td>
<td class="fielddoc">
Pointer to the next queue object (not expected to be modified by user) </td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gafc5f675378d6ed1ff7b2194defea4744" name="gafc5f675378d6ed1ff7b2194defea4744"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafc5f675378d6ed1ff7b2194defea4744">&#9670;&nbsp;</a></span>cyhal_ipc_event_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__ipc.html#gafc5f675378d6ed1ff7b2194defea4744">cyhal_ipc_event_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Flags enum of IPC events. </p>
<p >Multiple events can be enabled via <a class="el" href="group__group__hal__ipc.html#ga2f12eaf1973c7b31737bfae992343d00">cyhal_ipc_queue_enable_event</a> and the callback from <a class="el" href="group__group__hal__ipc.html#ga583dad7242f7a683a88d2299c5df9736">cyhal_ipc_queue_register_callback</a> will be run to notify. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggafc5f675378d6ed1ff7b2194defea4744a7485a38af1c68f218f3600ac537ad6e6" name="ggafc5f675378d6ed1ff7b2194defea4744a7485a38af1c68f218f3600ac537ad6e6"></a>CYHAL_IPC_NO_INTR&#160;</td><td class="fielddoc"><p >No interrupt. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggafc5f675378d6ed1ff7b2194defea4744a2db9e15f882cf6d039ba1202969bc6c2" name="ggafc5f675378d6ed1ff7b2194defea4744a2db9e15f882cf6d039ba1202969bc6c2"></a>CYHAL_IPC_QUEUE_WRITE&#160;</td><td class="fielddoc"><p >New item was written to the queue. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggafc5f675378d6ed1ff7b2194defea4744a304e44ce1ca284fb19474864b642aed7" name="ggafc5f675378d6ed1ff7b2194defea4744a304e44ce1ca284fb19474864b642aed7"></a>CYHAL_IPC_QUEUE_READ&#160;</td><td class="fielddoc"><p >New item was read from the queue. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggafc5f675378d6ed1ff7b2194defea4744a4327e5bbf3a3f1195a842b387b2bdab2" name="ggafc5f675378d6ed1ff7b2194defea4744a4327e5bbf3a3f1195a842b387b2bdab2"></a>CYHAL_IPC_QUEUE_FULL&#160;</td><td class="fielddoc"><p >Queue is full. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggafc5f675378d6ed1ff7b2194defea4744ac4c8cde7f590888b434a51c095d76626" name="ggafc5f675378d6ed1ff7b2194defea4744ac4c8cde7f590888b434a51c095d76626"></a>CYHAL_IPC_QUEUE_EMPTY&#160;</td><td class="fielddoc"><p >Queue is empty. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggafc5f675378d6ed1ff7b2194defea4744acf11c6dfa24aeb75841c8a9fd60ad0d7" name="ggafc5f675378d6ed1ff7b2194defea4744acf11c6dfa24aeb75841c8a9fd60ad0d7"></a>CYHAL_IPC_QUEUE_RESET&#160;</td><td class="fielddoc"><p >Queue was reset. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gab5103d75435543dbdc92c3e0d883d496" name="gab5103d75435543dbdc92c3e0d883d496"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab5103d75435543dbdc92c3e0d883d496">&#9670;&nbsp;</a></span>cyhal_ipc_semaphore_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_ipc_semaphore_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>semaphore_num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>preemptable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a single semaphore based on a given number. </p>
<p >The semaphore number range starts at 0. the max number depends on a few factors max = CYHAL_IPC_SEMA_COUNT - 1 (IPC driver semaphore) - num_queues - (num_queues * num_processes_per_queue)</p>
<p >This function must be called before accessing the semaphore. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to an IPC object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">semaphore_num</td><td>The semaphore number to initialize. Please refer to implementation specific documentation for valid range for this parameter. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">preemptable</td><td>Allows whether the semaphore can be preempted by another task. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="ga05b484a955e2ca55b25b6bbe296abb91" name="ga05b484a955e2ca55b25b6bbe296abb91"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga05b484a955e2ca55b25b6bbe296abb91">&#9670;&nbsp;</a></span>cyhal_ipc_semaphore_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_ipc_semaphore_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Frees the IPC semaphore. </p>
<p >This function frees the resources associated with the semaphore. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The IPC object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga2380599992f4a573e23c26c7fe4488f6" name="ga2380599992f4a573e23c26c7fe4488f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2380599992f4a573e23c26c7fe4488f6">&#9670;&nbsp;</a></span>cyhal_ipc_semaphore_take()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_ipc_semaphore_take </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout_us</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Takes/acquires a semaphore. </p>
<p >If the semaphore is available, it is acquired and this function and returns. This function has a timeout argument (in microseconds). If the semaphore is not available, it blocks until it times out or succeeds in acquiring it. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The IPC object. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout_us</td><td>Timeout in microseconds. Value 0 can be used if no timeout needed while <a class="el" href="group__group__hal__ipc.html#gafc143166a726ce930ed50e31bbb5cccc">CYHAL_IPC_NEVER_TIMEOUT</a> can be used to make function block until semaphore is successfully taken. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the take request </dd></dl>

</div>
</div>
<a id="gae2d8d3b44af0d4f2ed88614de5362bb4" name="gae2d8d3b44af0d4f2ed88614de5362bb4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae2d8d3b44af0d4f2ed88614de5362bb4">&#9670;&nbsp;</a></span>cyhal_ipc_semaphore_give()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_ipc_semaphore_give </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gives/releases a semaphore. </p>
<p >The semaphore is released allowing other tasks waiting on the semaphore to take it. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The IPC object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the give request </dd></dl>

</div>
</div>
<a id="ga227233ba6aab201896fa6910d819827d" name="ga227233ba6aab201896fa6910d819827d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga227233ba6aab201896fa6910d819827d">&#9670;&nbsp;</a></span>cyhal_ipc_queue_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_ipc_queue_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__ipc.html#structcyhal__ipc__queue__t">cyhal_ipc_queue_t</a> *&#160;</td>
          <td class="paramname"><em>queue_handle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new queue for a given IPC channel based on the given queue number and other parameters. </p>
<p >This function requires <a class="el" href="group__group__hal__ipc.html#structcyhal__ipc__queue__t">cyhal_ipc_queue_t</a> (queue handle) pointer to shared memory. Some elements of <a class="el" href="group__group__hal__ipc.html#structcyhal__ipc__queue__t" title="IPC queue structure element.">cyhal_ipc_queue_t</a> structure are expected to be filled by user. One key element of the structure to be filled by user is a pointer to the queue pool allocated in the shared memory. Queue handle is used by other tasks/CPUs to refer to the queue. Note that this function must be called only by one of the tasks/CPUs for the same IPC channel. This CPU can call the function multiple times for the same IPC channel, but with a different queue number. </p><dl class="section note"><dt>Note</dt><dd>CYHAL_IPC_QUEUE_HANDLE_ALLOC and CYHAL_IPC_QUEUE_POOL_ALLOC macro can (and not mandatory) be used in order to allocate memory for (respectively) queue handle (<a class="el" href="group__group__hal__ipc.html#structcyhal__ipc__queue__t" title="IPC queue structure element.">cyhal_ipc_queue_t</a>) and queue pool in shared section. Please refer to implementation specific documentation for the requirements for memory allocation if macro is not used. Please refer to <a class="el" href="group__group__hal__ipc.html#subsection_ipc_snippet2">Snippet 2: Message queue example</a> for initialization guidance. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to an IPC object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">queue_handle</td><td>Queue handle. Fields channel_num, queue_num, queue_pool, num_items and item_size are expected to be filled by user before initialization. Please refer to <a class="el" href="group__group__hal__ipc.html#subsection_ipc_snippet2">Snippet 2: Message queue example</a> for initialization guidance. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="gafdb349be3166a4468214a10f8c031e83" name="gafdb349be3166a4468214a10f8c031e83"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafdb349be3166a4468214a10f8c031e83">&#9670;&nbsp;</a></span>cyhal_ipc_queue_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_ipc_queue_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Frees the queue. </p>
<p >This operation only removes the queue handle from the list of available queues. The queue pool and the queue handle allocated in the shared memory needs to be freed (if dynamically allocated) by the application. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The IPC object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaeb3c9ad4caa2220aad9cdcea180b247c" name="gaeb3c9ad4caa2220aad9cdcea180b247c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeb3c9ad4caa2220aad9cdcea180b247c">&#9670;&nbsp;</a></span>cyhal_ipc_queue_get_handle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_ipc_queue_get_handle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>channel_num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>queue_num</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets a handle pointer for a given IPC channel and queue number. </p>
<p >This function should be called by other tasks/CPUs that have not called the initialization function. Unpredicted behavior can happen if this function is called before <a class="el" href="group__group__hal__ipc.html#ga227233ba6aab201896fa6910d819827d">cyhal_ipc_queue_init</a>. Please refer to implementation specific documentation for additional details. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>The IPC object handle. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">channel_num</td><td>IPC channel to use for the queue messaging. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">queue_num</td><td>Queue number. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the get handle request </dd></dl>

</div>
</div>
<a id="ga583dad7242f7a683a88d2299c5df9736" name="ga583dad7242f7a683a88d2299c5df9736"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga583dad7242f7a683a88d2299c5df9736">&#9670;&nbsp;</a></span>cyhal_ipc_queue_register_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_ipc_queue_register_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__ipc.html#ga979b9ad680c6ae674bd93d696581c897">cyhal_ipc_event_callback_t</a>&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>callback_arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers a callback to be executed when certain events occur. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The IPC object. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The callback handler which will be invoked when an event triggers. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_arg</td><td>Generic argument that will be provided to the callback when called. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga2f12eaf1973c7b31737bfae992343d00" name="ga2f12eaf1973c7b31737bfae992343d00"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2f12eaf1973c7b31737bfae992343d00">&#9670;&nbsp;</a></span>cyhal_ipc_queue_enable_event()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_ipc_queue_enable_event </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__ipc.html#gafc5f675378d6ed1ff7b2194defea4744">cyhal_ipc_event_t</a>&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>intr_priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables which events trigger the callback execution. </p>
<p >It can trigger when a new item is written to the queue, read from the queue, when the queue becomes full, when the queue becomes empty or when there is a reset. Note that these events might execute callbacks associated to all queues that belong to an IPC channel. When defining the ISR priority, the last call to this function overwrites the priority for all queue callbacks registered to the same IPC channel. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The IPC object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>The IPC event type </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">intr_priority</td><td>The priority for NVIC interrupt events </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>True to turn on specified events, False to turn off </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga0d27464dc25ca44fa9ac4c8c462742e8" name="ga0d27464dc25ca44fa9ac4c8c462742e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0d27464dc25ca44fa9ac4c8c462742e8">&#9670;&nbsp;</a></span>cyhal_ipc_queue_put()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_ipc_queue_put </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout_us</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds one item to the queue. </p>
<p >This function can be called by any task/CPU. This function has a timeout argument (in microseconds). If the queue is full, it stays there until it times out or the queue is no longer full. This function can be blocking or non-blocking (timeout set to ZERO). </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The IPC object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>Location of message queue item </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout_us</td><td>Timeout in microseconds. Value 0 can be used if no timeout needed while <a class="el" href="group__group__hal__ipc.html#gafc143166a726ce930ed50e31bbb5cccc">CYHAL_IPC_NEVER_TIMEOUT</a> can be used to make function block until element is successfully put into the queue. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the put request </dd></dl>

</div>
</div>
<a id="ga73345a07d50fa570083ab7be893405a7" name="ga73345a07d50fa570083ab7be893405a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga73345a07d50fa570083ab7be893405a7">&#9670;&nbsp;</a></span>cyhal_ipc_queue_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_ipc_queue_get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout_us</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes one item from the queue. </p>
<p >This function can be called by any task/CPU. This function has a timeout argument (in microseconds). If the queue is empty, it stays there until it times out or the queue receives a new item. This function can be blocking or non-blocking (timeout set to ZERO). </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The IPC object </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">msg</td><td>Location of message queue item </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout_us</td><td>Timeout in microseconds. Value 0 can be used if no timeout needed while <a class="el" href="group__group__hal__ipc.html#gafc143166a726ce930ed50e31bbb5cccc">CYHAL_IPC_NEVER_TIMEOUT</a> can be used to make function block until element is successfully taken from the queue. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the get request </dd></dl>

</div>
</div>
<a id="gaad0ce7366f3bda19fc538231f2b62298" name="gaad0ce7366f3bda19fc538231f2b62298"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaad0ce7366f3bda19fc538231f2b62298">&#9670;&nbsp;</a></span>cyhal_ipc_queue_count()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_ipc_queue_count </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns how many items are in the queue. </p>
<p >This function can be called by any task/CPU. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The IPC object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of items in the queue </dd></dl>

</div>
</div>
<a id="ga1b8d888b8a45e086a3489a5050f0899b" name="ga1b8d888b8a45e086a3489a5050f0899b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1b8d888b8a45e086a3489a5050f0899b">&#9670;&nbsp;</a></span>cyhal_ipc_queue_reset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_ipc_queue_reset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__ipc__t">cyhal_ipc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clear all the items in the queue. </p>
<p >This function can be called by the any task/CPU. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The IPC object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the reset request </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
